﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using WebApiClient.DataAnnotations;

namespace ARchGL.Platform.Mpp.InputModels
{
    /// <summary>
    /// 创建进度
    /// </summary>
    public class CreateMppProjectInput
    {
        /// <summary>
        /// 进度标识
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Company { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        public string Author { get; set; }

        /// <summary>
        /// 进度开始时间
        /// </summary>
        public DateTime StartDate { get; set; }

        /// <summary>
        /// 进度结束时间
        /// </summary>
        public DateTime FinishDate { get; set; }

        ///// <summary>
        ///// 计划开始时间
        ///// </summary>
        //public DateTime PlanStartDate { get; set; }

        ///// <summary>
        ///// 计划结束时间
        ///// </summary>
        //public DateTime PlanFinishDate { get; set; }
    }

    /// <summary>
    /// 更新进度
    /// </summary>
    public class ModifyMppProjectInput : CreateMppProjectInput
    {
    }

    public class PutMppProjectTaskInput<T>
    {
        /// <summary>
        /// 操作类型：create/update/delete
        /// </summary>
        [AliasAs("op")]
        [JsonProperty("op")]
        public string Opration { get; set; }

        /// <summary>
        /// 操作类型
        /// </summary>
        [AliasAs("type")]
        [JsonProperty("type")]
        public string Type { get => "task"; }

        /// <summary>
        /// 传入参数
        /// </summary>
        [AliasAs("data")]
        [JsonProperty("data")]
        public T Data { get; set; }
    }

    public class TaskCreateOrModifyInput
    {
        [AliasAs("Id")]
        [JsonProperty("Id")]
        public Guid Id { get; set; }

        [AliasAs("_ID")]
        [JsonProperty("_ID")]
        public long _ID { get; set; }

        [AliasAs("UID")]
        [JsonProperty("UID")]
        public long? UID { get; set; }

        [AliasAs("ParentId")]
        [JsonProperty("ParentId")]
        public Guid ParentId { get; set; }

        [AliasAs("Name")]
        [JsonProperty("Name")]
        public string Name { get; set; }

        [AliasAs("Start")]
        [JsonProperty("Start")]
        public DateTime Start { get; set; }

        [AliasAs("Finish")]
        [JsonProperty("Finish")]
        public DateTime Finish { get; set; }

        [AliasAs("Duration")]
        [JsonProperty("Duration")]
        public string Duration { get => "PT8H0M0S"; }

        [AliasAs("ActualStart")]
        [JsonProperty("ActualStart")]
        public DateTime ActualStart { get; set; }

        [AliasAs("ActualFinish")]
        [JsonProperty("ActualFinish")]
        public DateTime ActualFinish { get; set; }

        [AliasAs("WBS")]
        [JsonProperty("WBS")]
        public string WBS { get => "1"; }

        [AliasAs("Milestone")]
        [JsonProperty("Milestone")]
        public bool Milestone { get => false; }
    }

    public class TaskDeleteInput
    {
        [AliasAs("Id")]
        [JsonProperty("Id")]
        public Guid Id { get; set; }
    }
}
